 
    // LIFE-CYCLE CALLBACKS:

    // onLoad () {}

   function batchInitObjPool(thisO, objArray){
        
        for(var i=0; i< objArray.length; i++) {
            var objinfo = objArray[i];
            this.initObjPool(thisO, objinfo);
        }
    }
   
    function  initObjPool(thisO,objInfo){
 
        var name = objInfo.name;
        var poolName = name+'Pool';
        thisO[poolName] = new cc.NodePool();
        
        let initPollCount = objInfo.initPollCount;

        for (let ii = 0; ii < initPollCount; ++ii) {
            let nodeO = cc.instantiate(objInfo.prefab); // 创建节点
            thisO[poolName].put(nodeO); // 通过 putInPool 接口放入对象池
        }
    }

     //生成节点
    function genNewNode(pool,prefab,nodeParent){

        let newNode = null;
        if (pool.size() > 0) { // 通过 size 接口判断对象池中是否有空闲的对象
            newNode = pool.get();
        } else { // 如果没有空闲对象，也就是对象池中备用对象不够时，我们就用 cc.instantiate 重新创建
            newNode = cc.instantiate(prefab);
        }
        nodeParent.addChild(newNode);
        return newNode;
    }
   function  backObjPool(thisO,nodeinfo){
        var poolName = nodeinfo.name + 'Pool';
        thisO[poolName].put(nodeinfo); 
    }

    // update (dt) {}

export default{
    batchInitObjPool,
    initObjPool,
    genNewNode,
    backObjPool
}
